package cn.dxc.demo.common;

import java.util.Random;

public class RandomCode {

    private static final int  codes[]={0,1,2,3,4,5,6,7,8,9};

    public static String getCode(){
        int index = 0;
        StringBuffer stringBuffer = new StringBuffer();

        while(index<6){
            final int i = new Random().nextInt(10);
            stringBuffer.append(codes[i]);
            index++;
        }

        return stringBuffer.toString();

    }
}
